// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "WorldEntity.h"
#include "WorldRoadObjectOrientation.h"
#include "WorldRoadObjectParts.h"
#include "WorldLaneValidity.h"

/**
 * An entity of a road.
 */
class FWorldRoadObject : public FWorldEntity
{

public:

	using Ptr = std::shared_ptr<FWorldRoadObject>;
	using Super = FWorldEntity;

	FWorldEntityProperty< std::string >										Type;
	FWorldEntityProperty< std::string >										Name;
	FWorldEntityProperty< double >											S;
	FWorldEntityProperty< double >											T;
	FWorldEntityProperty< double >											ZOffset;
	FWorldEntityProperty< double >											ValidLength;
	FWorldEntityProperty< FWorldRoadObjectOrientation >						Orientation;
	FWorldEntityProperty< double >											Length;
	FWorldEntityProperty< double >											Width;
	FWorldEntityProperty< double >											Radius;
	FWorldEntityProperty< double >											Height;
	FWorldEntityProperty< double >											Hdg;
	FWorldEntityProperty< double >											Pitch;
	FWorldEntityProperty< double >											Roll;
	FWorldEntityPartArrayReference< FWorldRoadObjectRepeat, 0, INT_MAX >	Repeat;
	FWorldEntityPartReference< FWorldRoadObjectOutline, 0 >					Outline;
	FWorldEntityPartReference< FWorldRoadObjectMaterial, 0 >				Material;
	FWorldEntityPartArrayReference< FWorldLaneValidity, 0, INT_MAX >		Validity;
	FWorldEntityPartReference< FWorldRoadObjectParkingSpace, 0 >			ParkingSpace;

public:

	FWorldRoadObject();
	FWorldRoadObject(const json& j);
	~FWorldRoadObject() override;

	void Resolve(FWorldEntityReferencing& referencing) override;

	WORLD_ENTITY_META_DECLARE(FWorldRoadObject)

};
